package name.marz.to.go.ahg.core;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

public class Parameters extends HashMap<String, String> {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public List<NameValuePair> getNameValueList() {
		List<NameValuePair> list = new ArrayList<NameValuePair>();
		for ( Map.Entry<String, String> e : super.entrySet() ) {
			list.add(new BasicNameValuePair(e.getKey(), e.getValue()));
		}
		return list;
	}

	public NameValuePair getNameValuePair(String name) {
		return new BasicNameValuePair(name, get(name));
	}
	
	@Override
	public String toString() {
		return "Parameters [getNameValueList()=" + getNameValueList() + "]";
	}
}
